package org.atlantis.grosbeak.depot.proxy.value;

import org.atlantis.grosbeak.depot.DepotMaker;
import org.atlantis.grosbeak.depot.proxy.ValueProxy;

/**
 * 环境变量值代理。在配置文件中的格式应该是：“env :
 * 'JAVA_HOME'”，那么获得就是通过Syste.getenv("JAVA_HOME")得到的字符串。
 * 
 * @author <a href="mailto:seenoevil.cn@gmail.com">SeeNoEvil</a>
 * 
 */
public class EnvValueProxy implements ValueProxy {

	private String name;

	public EnvValueProxy(String name) {
		this.name = name;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * org.atlantis.grosbeak.depot.proxy.ValueProxy#get(org.atlantis.grosbeak
	 * .depot.DepotMaker)
	 */
	public Object get(DepotMaker maker) {
		return System.getenv(name);
	}
}
